import { Schema, model } from "mongoose";

interface Article {
    title: string,
    content: string,
    preview: string,
    createBy: string
}

const articleSchema = new Schema<Article>({
    title: { type: String, required: true },
    content: { type: String, required: true },
    preview: { type: String, required: true },
    createBy: { type: String, required: true }
})

export const ModelArticle = model<Article>('Article', articleSchema)